/*
2021-11-8
https://ac.nowcoder.com/acm/contest/22551/G
*/
#include<iostream>
#include<algorithm>
#include<cstring>

using namespace std;
int a[100050];
char s[100050];
int main() {
    scanf("%s", s + 1);
    int n = strlen(s + 1);
    int m;
    scanf("%d", &m);
    for (int i = 1; i <= m; i++) {
        int x;
        scanf("%d", &x);
        a[x]++, a[n - x + 2]--;
    }
    for (int i = 1; i <= n; i++)
        a[i] = a[i - 1] + a[i];
    for (int i = 1; i <= n; i++)
        if (a[i] % 2) printf("%c", s[n - i + 1]); else printf("%c", s[i]);
    return 0;
}
